package com.zimin.cloud.system.biz.impl;

import com.zimin.cloud.mine.pojo.system.view.AccountVO;
import com.zimin.cloud.mine.pojo.system.view.LoginVO;
import com.zimin.cloud.system.biz.ILoginInfoBiz;
import com.zimin.cloud.system.pojo.entity.LoginInfo;
import com.zimin.cloud.system.service.impl.LoginInfoServiceImpl;
import com.zimin.common.annotation.Biz;
import com.zimin.common.constant.StringPool;
import com.zimin.common.utils.ServletUtil;


/**
 * <p>
 * 系统访问记录 业务对象
 * </p>
 *
 * @author zimin
 * @since 2021-12-30 11:05
 */
@Biz("loginInfoBiz")
public class LoginInfoBizImpl extends LoginInfoServiceImpl implements ILoginInfoBiz {

    @Override
    public boolean save(LoginVO loginVO) {
        var accountVO = loginVO.getAccountVO();
        var loginInfo = LoginInfo.builder()
                .loginName(accountVO.getAccountName())
                .ip(ServletUtil.getIp())
                .loginLocation(null)
//                .browser()
                .build();
        return super.save(loginInfo);
    }

}
